import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 邓大帅
 * Date: 2024-01-26
 * Time: 18:33

IDEA的工作目录就是创建的项目所在的目录
 */
public class IODemo1 {
    public static void main(String[] args) throws IOException {
        File file = new File("./test.txt");
        System.out.println(file.getParent());
        System.out.println(file.getName());
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getCanonicalFile());
        //创建文件
        file.createNewFile();
        System.out.println(file.exists());
        System.out.println(file.isFile());
        System.out.println(file.isDirectory());
        //删除文件
        file.delete();
        System.out.println("删除文件之后");
        System.out.println(file.exists());
    }
}
